export const toggle = {
    data() {
        return {
            info: {
                isShow: false,
                isAdd: true,
            },
        }
    },
    methods: {
        showAddPop() {
            this.info.isShow = true;
            this.info.isAdd = true;
        },
        showUpdate(id) {
            this.info.isAdd = false;
            this.info.isShow = true;
            this.$refs.form.getOne(id);
        },
    }
}

export const formClose = {
    methods: {
        //点击关闭取消按钮
        cancel() {
            this.info.isShow = false;
        },
        //关闭弹窗是否清空表单
        close() {
            if (!this.info.isAdd) {
                this.empty()
            }
        }
    }
}